package com.hskn.hss.module.messageFlowRecords.controller;

import com.hskn.hss.core.controller.BaseController;
import com.hskn.hss.core.domain.AjaxResult;
import com.hskn.hss.core.page.TableDataInfo;
import com.hskn.hss.core.utils.poi.ExcelUtil;
import com.hskn.hss.module.messageFlowRecords.domain.MessageFlowRecords;
import com.hskn.hss.module.messageFlowRecords.service.IMessageFlowRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 消息流水Controller
 * 
 * @author ccm
 * @date 2021-09-14
 */
@RestController
@RequestMapping("/messageFlowRecords")
public class MessageFlowRecordsController extends BaseController
{
    @Autowired
    private IMessageFlowRecordsService messageFlowRecordsService;


    /**
     * 导出消息流水列表
     */
    @GetMapping("/export")
    public AjaxResult export(MessageFlowRecords messageFlowRecords)
    {
        List<MessageFlowRecords> list = messageFlowRecordsService.selectMessageFlowRecordsList(messageFlowRecords);
        ExcelUtil<MessageFlowRecords> util = new ExcelUtil<MessageFlowRecords>(MessageFlowRecords.class);
        return util.exportExcel(list, "消息流水数据");
    }

    /**
     * 获取消息流水详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return AjaxResult.success(messageFlowRecordsService.selectMessageFlowRecordsById(id));
    }


}
